package com.qf.dao;

import com.qf.pojo.User;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * @author 千锋健哥
 */
public interface UserMapper {

    /**
     * 查询用户所有数据
     * @return
     */
    @Select("select * from  t_users")
    public List<User> findUserAll();

    /**
     * 根据主键查询
     * @param id
     * @return
     */
    @Select("select * from  t_users where id=#{id}")
    public User findUserById(@Param("id") Integer id);

    @Insert("insert into t_users (name, password, sex, birthday, registTime) " +
            " values(#{name}, #{password}, #{sex}, #{birthday}, #{registTime})")
    public void insert(User user);
}
